package algorithm;

public class MParameter {
	private ParaType type = ParaType.STRING;
	private Object max;
	private Object min;
	private String name;

	public MParameter() {
		max = 0;
		min = 0;
		name = "";
	}

	public MParameter(ParaType type, String name) {
		this();
		this.type = type;
		this.name = name;
	}

	public MParameter(ParaType type, String name, Object max, Object min) {
		this(type, name);
		this.max = max;
		this.min = min;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public ParaType getParaType() {
		return type;
	}

	public String getParaTypeByString() {
		String ty = "String";
		switch (type) {
		case STRING:
			ty = "String";
			break;
		case INTEGER:
			ty = "Integer";
			break;
		case DOUBLE:
			ty = "Double";
			break;
		}
		return ty;
	}

	public void setParaType(String paraType) {
		if (paraType.equals("String"))
			type = ParaType.STRING;
		else if (paraType.equals("int") || paraType.equals("Integer"))
			type = ParaType.INTEGER;
		else if (paraType.equals("double") || paraType.equals("Double"))
			type = ParaType.DOUBLE;
	}

	public Object getMax() {
		return max;
	}

	public void setMax(Object max) {
		this.max = max;
	}

	public Object getMin() {
		return min;
	}

	public void setMin(Object min) {
		this.min = min;
	}

}

